#!/usr/bin/env python

import sys
import socket
import OSC
from threading import Thread

class oscClient(Thread):

	def __init__(self, port):
		Thread.__init__(self)
		self.port = port

	def getOSC(self):
		s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
		s.bind(('', self.port))
	
		while 1:
			data, address = s.recvfrom(1024)
			print address
			OSC.hexDump(data)
			print OSC.decodeOSC(data)


if __name__ == "__main__":
	port = 8085
	osc = oscClient(port)
	osc.getOSC()